package kg.aibek.projecteuler.p10;

public class Problem10 {
	private static final int LIMIT = 2000000;

	private static boolean isPrime(int number) {
		for (int i = 2; i * i <= number; i++) {
			if (number % i == 0)
				return false;
		}
		return true;
	}

	public static void main(String[] args) {
		long sum = 2;

		int n = 3;
		while (n < LIMIT) {
			if (isPrime(n)) {
				sum += n;
			}
			n += 2;
		}

		System.out.println(sum);

	}
}
